home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games: Greatest Hits 1996
/
Amiga Games: Greatest Hits 1996.iso
/
rexx
/
printlabel.mbrx
< prev
next >
Wrap
Text File
|
1996-06-28
|
1KB
|
75 lines
/*
** PrintLabel.mbrx Version 1.0
** By Tom Bampton
**
** © 1996 Eden Software
**
** This little script prints out address labels
*/
/* Line Feed character to print new lines */
LF='0a'x
/*
The path to MegaBook in case it isn't running
*/
MegaBookPath = 'MegaBook3:MegaBook'
/* Check if MegaBook is running, if not, run it */
if ~show('P', 'MEGABOOK.01') then do
address command
'run >nil: ' MegaBookPath
/* Wait for the ARexx port */
do 5 while ~show('P', 'MEGABOOK.01')
'sys:rexxc/waitforport MEGABOOK.01'
end
end
address 'MEGABOOK.01'
options results
/* Get the details for the label */
Get_Entry 1
name = result
Get_Entry 2
addr = result
Get_Entry 3
blnk = result
Get_Entry 4
town = result
Get_Entry 5
county = result
Get_Entry 6
pcode = result
/* Now print the label, missing the empty fields */
if name ~= '' then do
Print name
Print LF
end
if addr ~= '' then do
Print addr
Print LF
end
if blnk ~= '' then do
Print blnk
Print LF
end
if town ~= '' then do
Print town
Print LF
end
if county ~= '' then do
Print county
Print " "
end
/* Just for a laff, we'll bring up a requester if there's no postcode */
if pcode ~= '' then do
Print pcode
end
else do
Request 'Come on, think of those poor postmen and women!' LF 'Please use the postcode!' Gads 'Sorry, wont happen again'
end
Print LF